import axios from './../libs/api.request'
let url = ''

// 用户授权
export const login = (data) => {
  return axios.request({
    url: '/login/login',
    data,
    method: 'post'
  })
}

//退出登录
export const logOut = (data) => {
  return axios.request({
    url: '/company/logout',
    data,
    method: 'post'
  })
}

// 商品列表
export const productList = (data) => {
  return axios.request({
    url: '/goods/getlist',
    data,
    method: 'post'
  })
}

// 地址列表
export const addressList = (data) => {
  return axios.request({
    url: '/address/getlist',
    data,
    method: 'post'
  })
}

//添加地址
export const addAddress = (data) => {
  return axios.request({
    url: '/address/add',
    data,
    method: 'post'
  })
}

//删除地址
export const deladdress = (data) => {
  return axios.request({
    url: '/address/delete',
    data,
    method: 'post'
  })
}

// 地址
export const region = (data) => {
  return axios.request({
    url: '/address/region',
    data,
    method: 'post'
  })
}

// 创建
export const create = (data) => {
  return axios.request({
    url: '/order/create',
    data,
    method: 'post'
  })
}

// 取消
export const cancel = (data) => {
  return axios.request({
    url: '/order/cancel',
    data,
    method: 'post'
  })
}

// 查询现金账户余额
export const balance = (data) => {
  return axios.request({
    url: '/company/balance',
    data,
    method: 'post'
  })
}

// 订单列表
export const relation = (data) => {
  return axios.request({
    url: '/order/relation',
    data,
    method: 'post'
  })
}

// 查询现金账户余额
export const stock = (data) => {
  return axios.request({
    url: '/goods/stock',
    data,
    method: 'post'
  })
}

// 退出登录
export const logout = (data) => {
  return axios.request({
    url: '/company/logout',
    data,
    method: 'post'
  })
}

//订单详情
export const orderDetails = (data) => {
  return axios.request({
    url: '/order/detail',
    data,
    method: 'post'
  })
}

